package com.hsnn.medstgmini.base.std.model;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.hsnn.medstgmini.base.dict.model.DicDrugform;
import com.hsnn.medstgmini.base.dict.model.DicDrugmaterial;
import com.hsnn.medstgmini.base.dict.model.DicDrugspec;
import com.hsnn.medstgmini.sys.model.SysUser;

/**
 * StdDruginfoLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "std_druginfo_log")
public class StdDruginfoLog implements java.io.Serializable {

	// Fields

	private String logId;
	private String drugId;
	private String drugCode;
	private String drugName;
	private String drugNameSpel;
	private String drugNameEng;
	private String busName;
//	private String formId;
	private DicDrugform drugform;
//	private String specId;
	private DicDrugspec drugspec;
	private Integer factor;
	private String unit;
//	private String prodCompId;
	private StdCompinfo compinfo;
//	private String materialId;
	private DicDrugmaterial drugmaterial;
	private String approvalCode;
	private Date approvalDate;
	private Short status;
	private Date updDatetime;
//	private String updUser;
	private SysUser sysUser;
	private String historyDrugCode;
	private Short mergeStatus;

	// Constructors

	/** default constructor */
	public StdDruginfoLog() {
	}

	/** minimal constructor */
	public StdDruginfoLog(String drugId, String drugCode, String drugName,
			String formId, String specId, String prodCompId) {
		this.drugId = drugId;
		this.drugCode = drugCode;
		this.drugName = drugName;
//		this.formId = formId;
//		this.specId = specId;
//		this.prodCompId = prodCompId;
	}

	/** full constructor */
	public StdDruginfoLog(String drugId, String drugCode, String drugName,
			String drugNameSpel, String drugNameEng, String busName,
			String formId, String specId, Integer factor, String unit,
			String prodCompId, String materialId, String approvalCode,
			Timestamp approvalDate, Short status, Timestamp updDatetime,
			String updUser, String historyDrugCode, Short mergeStatus) {
		this.drugId = drugId;
		this.drugCode = drugCode;
		this.drugName = drugName;
		this.drugNameSpel = drugNameSpel;
		this.drugNameEng = drugNameEng;
		this.busName = busName;
//		this.formId = formId;
//		this.specId = specId;
		this.factor = factor;
		this.unit = unit;
//		this.prodCompId = prodCompId;
//		this.materialId = materialId;
		this.approvalCode = approvalCode;
		this.approvalDate = approvalDate;
		this.status = status;
		this.updDatetime = updDatetime;
//		this.updUser = updUser;
		this.historyDrugCode = historyDrugCode;
		this.mergeStatus = mergeStatus;
	}

	// Property accessors
	@Id
	@Column(name = "log_id", unique = true, nullable = false, length = 36)
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	@Column(name = "drug_id", nullable = false, length = 36)
	public String getDrugId() {
		return this.drugId;
	}

	public void setDrugId(String drugId) {
		this.drugId = drugId;
	}

	@Column(name = "drug_code", nullable = false, length = 100)
	public String getDrugCode() {
		return this.drugCode;
	}

	public void setDrugCode(String drugCode) {
		this.drugCode = drugCode;
	}

	@Column(name = "drug_name", nullable = false, length = 512)
	public String getDrugName() {
		return this.drugName;
	}

	public void setDrugName(String drugName) {
		this.drugName = drugName;
	}

	@Column(name = "drug_name_spel", length = 128)
	public String getDrugNameSpel() {
		return this.drugNameSpel;
	}

	public void setDrugNameSpel(String drugNameSpel) {
		this.drugNameSpel = drugNameSpel;
	}

	@Column(name = "drug_name_eng", length = 512)
	public String getDrugNameEng() {
		return this.drugNameEng;
	}

	public void setDrugNameEng(String drugNameEng) {
		this.drugNameEng = drugNameEng;
	}

	@Column(name = "bus_name", length = 256)
	public String getBusName() {
		return this.busName;
	}

	public void setBusName(String busName) {
		this.busName = busName;
	}

//	@Column(name = "form_id", nullable = false, length = 36)
//	public String getFormId() {
//		return this.formId;
//	}

//	public void setFormId(String formId) {
//		this.formId = formId;
//	}

//	@Column(name = "spec_id", nullable = false, length = 36)
//	public String getSpecId() {
//		return this.specId;
//	}
//
//	public void setSpecId(String specId) {
//		this.specId = specId;
//	}

	@Column(name = "factor")
	public Integer getFactor() {
		return this.factor;
	}

	public void setFactor(Integer factor) {
		this.factor = factor;
	}

	@Column(name = "unit", length = 36)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

//	@Column(name = "prod_comp_id", nullable = false, length = 36)
//	public String getProdCompId() {
//		return this.prodCompId;
//	}
//
//	public void setProdCompId(String prodCompId) {
//		this.prodCompId = prodCompId;
//	}

//	@Column(name = "material_id", length = 36)
//	public String getMaterialId() {
//		return this.materialId;
//	}
//
//	public void setMaterialId(String materialId) {
//		this.materialId = materialId;
//	}

	@Column(name = "approval_code", length = 100)
	public String getApprovalCode() {
		return this.approvalCode;
	}

	public void setApprovalCode(String approvalCode) {
		this.approvalCode = approvalCode;
	}

	@Column(name = "approval_date", length = 19)
	public Date getApprovalDate() {
		return this.approvalDate;
	}

	public void setApprovalDate(Date approvalDate) {
		this.approvalDate = approvalDate;
	}

	@Column(name = "status")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name = "upd_datetime", length = 19)
	public Date getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}

//	@Column(name = "upd_user", length = 36)
//	public String getUpdUser() {
//		return this.updUser;
//	}
//
//	public void setUpdUser(String updUser) {
//		this.updUser = updUser;
//	}

	@Column(name = "history_drug_code", length = 100)
	public String getHistoryDrugCode() {
		return this.historyDrugCode;
	}

	public void setHistoryDrugCode(String historyDrugCode) {
		this.historyDrugCode = historyDrugCode;
	}

	@Column(name = "merge_status")
	public Short getMergeStatus() {
		return this.mergeStatus;
	}

	public void setMergeStatus(Short mergeStatus) {
		this.mergeStatus = mergeStatus;
	}
	@ManyToOne(cascade = { CascadeType.ALL })
    @NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "form_id")
	public DicDrugform getDrugform() {
		return drugform;
	}

	public void setDrugform(DicDrugform drugform) {
		this.drugform = drugform;
	}
	@ManyToOne(cascade = { CascadeType.ALL })
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "spec_id")
	public DicDrugspec getDrugspec() {
		return drugspec;
	}

	public void setDrugspec(DicDrugspec drugspec) {
		this.drugspec = drugspec;
	}
	@javax.persistence.ManyToOne(cascade = { CascadeType.ALL })
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "prod_comp_id")
	public StdCompinfo getCompinfo() {
		return compinfo;
	}

	public void setCompinfo(StdCompinfo compinfo) {
		this.compinfo = compinfo;
	}
	@javax.persistence.ManyToOne(cascade = { CascadeType.ALL })
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "material_id")
	public DicDrugmaterial getDrugmaterial() {
		return drugmaterial;
	}

	public void setDrugmaterial(DicDrugmaterial drugmaterial) {
		this.drugmaterial = drugmaterial;
	}
	@javax.persistence.ManyToOne(cascade = { CascadeType.ALL })
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "upd_user")
	public SysUser getSysUser() {
		return sysUser;
	}

	public void setSysUser(SysUser sysUser) {
		this.sysUser = sysUser;
	}

}